<?php

class EntryForm extends CFormModel
{
	public $name;
	public $status;
	public $contestId;
	public $upload;

	/**
	 * Declares the validation rules.
	 */
	public function rules()
	{
		return array(
			array('name, status, contestId', 'required'),
			array('upload', 'required', 'on'=>'create'),
			array('status', 'numerical', 'integerOnly'=>true),
			array('upload', 'file', 'types'=>'jpg, gif, png', 'allowEmpty'=>true),
		);
	}

	/**
	 * Decalres the attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'name' => Yii::t('label','Name'),
			'status' => Yii::t('label','Status'),
			'contestId' => Yii::t('label','Contest'),
			'upload' => Yii::t('label','Image'),
		);
	}
}
